package com.tarim.streetdance.mapper;

import com.tarim.streetdance.model.Video;
import com.tarim.streetdance.model.VideoWithBLOBs;
import com.tarim.streetdance.vo.Criteria;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Mapper
@Component("VideoMapper")
public interface VideoMapper {
    //根据类别查视频
    List<VideoWithBLOBs> selectVideoByType(VideoWithBLOBs record);
    Long selectVideoByTypeCount(VideoWithBLOBs record);

    int deleteByPrimaryKey(Long id);

    int insert(VideoWithBLOBs record);

    //新增
    int insertSelective(VideoWithBLOBs record);

    //查询视频带评论
    VideoWithBLOBs selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(VideoWithBLOBs record);

    int updateByPrimaryKeyWithBLOBs(VideoWithBLOBs record);

    int updateByPrimaryKey(Video record);

    int updateForDelete(Video record);

    //点赞数量+1
    int updateForAddLikenum(Video record);
    //观看数量+1
    int updateForAddViewsnum(Video record);
    //收藏数量+1
    int updateForAddCollectnum(Video record);

    List<Map> selectStateNum();

    List<VideoWithBLOBs> selectVideoByUserId(VideoWithBLOBs record);
    Long selectVideoByUserIdCount(VideoWithBLOBs record);

    List<VideoWithBLOBs> selectVideoByCondition(Criteria criteria);
    Long selectVideoByConditionCount(Criteria criteria);
}